﻿using System;

namespace MethodCaching
{
    /// <summary>
    /// Simple guard helper class 
    /// </summary>
    public static class Guard
    {
        /// <summary>
        /// Verifies that the argument passed to a method is not null.
        /// </summary>
        /// <param name="value">The value to be checked.</param>
        /// <param name="paramName">The name of the parameter.</param>
        /// <exception cref="ArgumentNullException">Thrown if the <paramref name="value"/> is null.</exception>
        public static void IsNotNull(object value, string paramName)
        {
            if (value == null)
                throw new ArgumentNullException(paramName);
        }
    }
}
